

import 'package:changxindianzishangwu/cache/local_cache.dart';
import 'package:changxindianzishangwu/http/base/ec_base_request.dart';
import 'package:changxindianzishangwu/http/request/report_list_request.dart';
import 'package:changxindianzishangwu/http/request/report_submit_request.dart';
import 'package:changxindianzishangwu/http/zd_net.dart';
import 'package:changxindianzishangwu/model/report_list_model.dart';

class ReportDao {
  static getEmojiList(int type) async {
    EcBaseRequest request = ReportListRequest();
    request
        .add("type", type)
        .add("access_token", getAppLoginToken());
    var result = await ZdNet.getInstance().send(request);

    ReportListModel collectListModel = ReportListModel.fromJson(result);
    return collectListModel;
  }
  static submit(int reason,String info,{String objectId,int type,String imageUrls}) async {
    EcBaseRequest request = ReportSubmitRequest();
    request
        .add("reason", reason)
        .add("info", info)
        .add(type==1?"toUserId":"roomId", objectId)
        .add("imageUrls", imageUrls)
        .add("access_token", getAppLoginToken());
    var result = await ZdNet.getInstance().send(request);

    return result["resultCode"];
  }
}